package cn.wolfcode.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
//@TableName("t_employee") //当表名和类名不一致时可以通过注解来声明
public class Employee {
    @TableId(value ="id" ,type = IdType.AUTO)//设置主键自增,如果使用的雪花算法那么自增的数据时没有顺序
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    private String name;
    private String password;
    private String email;
    private int age;
    private int admin;
    private Long deptId;
    @TableField(value ="dept",exist = false)
    private Department dept;
}
